﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OFB.BLL.Context;

namespace OFB.BLL.Repository
{
    public class ReportSubjectBLL
    {
        private ReportSubjectContext context;
        public ReportSubjectBLL()
        {
            context = new ReportSubjectContext();
        }

        public ICollection<Domain.Subject> GetSubjectByCourse(int courseId)
        {
            //Gọi context Init(), truyền store procedure name là Report_GetSubjectsByCourse và parameter
            return context.Subject.Init("Report_GetSubjectsByCourse", context.Subject.BuildParameter("CourseId", System.Data.DbType.Int32, courseId))
                .MapCollection<Domain.Subject>().GetCollection();
        }
    }
}
